//
//  NSString+time.m
//  com.Ofans
//
//  Created by wang on 15-4-13.
//  Copyright (c) 2015年 wang. All rights reserved.
//

#import "NSString+time.h"

@implementation NSString (time)

- (NSString *)getMyFormatDateWithandFormat:(NSString *)format
{
    NSDate *date=[[NSDate alloc] initWithTimeIntervalSince1970:[self doubleValue]];
    NSDateFormatter *formatter=[[NSDateFormatter  alloc] init];
    formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US"];
    [formatter setDateFormat:format];
    return [formatter stringFromDate:date];
}
- (NSDate *)dateFromStringWithFormat:(NSString *)format
{
    NSDateFormatter *formatter=[[NSDateFormatter  alloc] init];
    formatter.locale = [NSLocale localeWithLocaleIdentifier:@"en_US"];
    [formatter setDateFormat:format];
    return [formatter dateFromString:self];
}

- (NSDate *)getMyFormatDate
{
    return [[NSDate alloc] initWithTimeIntervalSince1970:[self doubleValue]];
}



@end
